package ooday02;

public class test2 {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("金毛",3,"金");
        dogs[1] = new Dog("阿拉斯加",2,"灰");
        dogs[2] = new Dog("秋田犬",3,"黄");
        for (int z = 0;z<dogs.length;z++){
            System.out.println(dogs[z].name);
            dogs[z].eat();
            dogs[z].drink();
            dogs[z].lookHome();
            dogs[z].swim();
        }
        Fish[] fish = new Fish[3];
        fish[0] = new Fish("金鱼",3,"金");
        fish[1] = new Fish("金枪鱼",2,"蓝");
        fish[2] = new Fish("旗鱼",3,"红");
        for (int z = 0;z<fish.length;z++){
            System.out.println(fish[z].name);
            fish[z].eat();
            fish[z].drink();
            fish[z].swim();
        }
        Chick[] chicks = new Chick[3];
        chicks[1] = new Chick("母鸡",2,"红");
        chicks[2] = new Chick("野鸡",2,"灰");
        chicks[0] = new Chick("公鸡",2,"橙红");
        for (int z = 0;z<dogs.length;z++){
            System.out.println(chicks[z].name);
            fish[z].eat();
            fish[z].drink();
        }
    }
}
